//******************************************************
//     Fixing problems with Compiler/Assembler/objcopy
//     2001/2/6 Fixing problems with Compiler.txt
//     Copyright (C) 1999-2001 NINTENDO Co.,Ltd.
//******************************************************


The problems regarding Compiler, Assembler, and objcopy.exe were fixed.  
The following files were updated with AGB Developers ToolKit Version 3.0.
(The old files remain after being renamed as ***_000512.exe.)


[Updated files]               [Placing directory]
  thumb/cc1.exe               : Cygnus\thumbelf-000512\H-i686-cygwin32\lib\gcc-lib\thumb-elf\2.9-arm-000512
  thumb/as.exe                : Cygnus\thumbelf-000512\H-i686-cygwin32\thumb-elf\bin
                              : Cygnus\thumbelf-000512\H-i686-cygwin32\bin
  thumb/gasp.exe              : Cygnus\thumbelf-000512\H-i686-cygwin32\bin
  thumb/objcopy.exe           : Cygnus\thumbelf-000512\H-i686-cygwin32\bin
  thumb/thumb-elf-as.exe      : Cygnus\thumbelf-000512\H-i686-cygwin32\bin
  thumb/thumb-elf-gasp.exe    : Cygnus\thumbelf-000512\H-i686-cygwin32\bin
  thumb/thumb-elf-objcopy.exe : Cygnus\thumbelf-000512\H-i686-cygwin32\bin




--Fixes--


* Fixed the problem regarding comparing of unsigned short variables.  

(Problem example)
When the following source is compiled with -O2 option, the wrong code is created.

unsigned short b16 = 0xfff0;

sub()
{
     b16 += 0x0040;

     if (b16 + 0x20 >= 0x0100) {
     b16 = 0;
     }
}

If this result is displayed by objdump,

  00000000 <sub>:
      0:     4904  4904  ldr   r1,  [pc, #16]   (14 <sub+0x14>)
      2:     8808  8808  ldrh  r0,  [r1, #0]
      4:     3040  3040  add   r0,  #64
      6:     8008  8008  strh  r0,  [r1, #0]
      8:     3020  3020  add   r0,  #32
      a:     28ff  28ff  cmp   r0,  #255
      c:     dd01  dd01  ble   12   <sub+0x12>
      e:     2000  2000  mov   r0,  #0
     10:     8008  8008  strh  r0,  [r1, #0]
     12:     4770  4770  bx    lr
     14:     0000  0000  lsl   r0,  r0,  #0
        ...

When added, it is carried to upper 16bit, and it should compare with unsigned 
short variables in the following line, but comparison is made with garbage in 
upper 16bit.


* When variable length string of GCC extended grammar is used, the return value 
  of the function is not correct. It was fixed.

Problem example)

static int Test( int Arg1, char *Message ) {

   int Size = 4;
   char Table[Size];  //GCC extended grammer automatic arrays are used.
   int Dummy = 0;

   return 1;

DUMMY_LABEL:
   sprintf( Message, "%X%X%X", Dummy, Dummy, Dummy );
   return 0;
}


* Fixed the problem regarding the address calculation with as.

Problem example)

[Example (as_test.s)]

   .TEXT
   .ALIGN
TestStartAdr:
   .word  (TestEndAdr - TestStartAdr)
   .word  (TestStartAdr - TestEndAdr)
   .word  (TestEndAdr - TestStartAdr) << 8
   .word  (TestStartAdr - TestEndAdr) << 8
   .word  (TestEndAdr - TestStartAdr) / 2
   .word  (TestStartAdr - TestEndAdr) / 2
   .word  (TestEndAdr - TestStartAdr) * 2
   .word  (TestStartAdr - TestEndAdr) * 2
TestEndAdr:

   .END

[Command Line]

 as as_test.s


[Output by GNUPro-98r2 (GNU assembler version 2.9-armelf-981216 (thumb-elf)
using BFD version 2.9-armelf-981216)]

TestStartAdr:
   0x00000020
   0xffffffe0
   0x00002000
   0xffffe000
   0x00000010
   0xfffffff0
   0x00000040
   0xffffffc0
TestEndAdr:

[Output by GNUPro-99r1p3 (GNU assembler version 2.9-arm-000512 (thumb-elf)
using BFD version 2.9-arm-000512)]

TestStartAdr:
   0x00000020
   0x00000000
   0x00000000
   0x00000000
   0x00000000
   0x00000000
   0x00000000
   0x00000000
TestEndAdr:


* Fixed so that the warning objcopy output is suppressed.

Old warning)
objcopy: Warning: Output file cannot represent architecture UNKNOWN!



